{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.   0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1  0.11 0.12 0.13\n",
      " 0.14 0.15 0.16 0.17 0.18 0.19 0.2  0.21 0.22 0.23 0.24 0.25 0.26 0.27\n",
      " 0.28 0.29 0.3  0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4  0.41\n",
      " 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5  0.51 0.52 0.53 0.54 0.55\n",
      " 0.56 0.57 0.58 0.59 0.6  0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69\n",
      " 0.7  0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8  0.81 0.82 0.83\n",
      " 0.84 0.85 0.86 0.87 0.88 0.89 0.9  0.91 0.92 0.93 0.94 0.95 0.96 0.97\n",
      " 0.98 0.99]\n",
      "[-1.63940639e-02 -2.43269452e-03  1.72181654e-02 -5.91710475e-03\n",
      "  1.23633129e-03 -3.92846143e-03 -1.46078118e-02  2.27152013e-03\n",
      " -1.92267209e-03 -8.84939064e-05 -2.64701869e-03 -4.88509943e-03\n",
      " -8.35938990e-03 -2.41402855e-02 -3.44492322e-03  1.60962112e-03\n",
      " -7.83788261e-03 -4.51464723e-04 -2.47423453e-03 -9.58019058e-03\n",
      "  1.05237669e-02  1.14242559e-03 -2.40235915e-03  1.22164854e-02\n",
      " -6.97186625e-04  1.40854038e-02 -4.70102972e-03  9.93034810e-03\n",
      " -5.88880288e-03  6.05852628e-05 -5.16312404e-03  3.62084080e-03\n",
      "  1.44662910e-02  2.16479272e-03 -8.48202585e-03 -1.34990329e-03\n",
      "  9.12062066e-03 -2.41615676e-03  3.77650556e-03 -2.80929101e-02\n",
      " -8.33542305e-03 -2.50691525e-03 -1.17158709e-02  9.04167429e-03\n",
      " -7.17748548e-04  5.10537546e-03  2.68735642e-03 -1.19458657e-03\n",
      " -8.43814524e-03  7.01128630e-03  1.47293998e-02  1.50185435e-03\n",
      " -1.16300329e-02  8.54848959e-03  1.40652421e-03 -4.59005678e-03\n",
      "  8.14589265e-03  6.80644998e-03  1.51244979e-02 -2.85022572e-03\n",
      "  5.05620849e-03 -1.63227191e-02 -1.16043394e-02  2.34984739e-03\n",
      " -1.81551081e-02  2.11701800e-02  4.24262116e-03  7.35285341e-03\n",
      " -2.92432502e-03 -1.48090725e-02 -1.01573222e-02  6.34295040e-03\n",
      "  5.12565641e-03 -1.10810829e-02 -1.90206945e-02  1.33954777e-02\n",
      " -2.10052719e-02 -2.39300999e-03 -2.40706799e-04  4.95954056e-03\n",
      "  9.54628509e-03 -2.44723089e-03  1.20303121e-03  7.11176507e-04\n",
      "  6.38971140e-04 -1.83828427e-03  1.12638066e-02  6.68142971e-04\n",
      " -1.27859531e-02 -1.51582144e-03 -7.35506518e-03  8.09312277e-04\n",
      " -1.32699710e-02 -9.03032620e-03  8.93858632e-03 -6.77032259e-04\n",
      " -2.95147384e-03 -7.25134856e-03 -1.35704953e-04  3.65338350e-03]\n",
      "[-0.01639406  0.00756731  0.03721817  0.0240829   0.04123633  0.04607154\n",
      "  0.04539219  0.07227152  0.07807733  0.08991151  0.09735298  0.1051149\n",
      "  0.11164061  0.10585971  0.13655508  0.15160962  0.15216212  0.16954854\n",
      "  0.17752577  0.18041981  0.21052377  0.21114243  0.21759764  0.24221649\n",
      "  0.23930281  0.2640854   0.25529897  0.27993035  0.2741112   0.29006059\n",
      "  0.29483688  0.31362084  0.33446629  0.33216479  0.33151797  0.3486501\n",
      "  0.36912062  0.36758384  0.38377651  0.36190709  0.39166458  0.40749308\n",
      "  0.40828413  0.43904167  0.43928225  0.45510538  0.46268736  0.46880541\n",
      "  0.47156185  0.49701129  0.5147294   0.51150185  0.50836997  0.53854849\n",
      "  0.54140652  0.54540994  0.56814589  0.57680645  0.5951245   0.58714977\n",
      "  0.60505621  0.59367728  0.60839566  0.63234985  0.62184489  0.67117018\n",
      "  0.66424262  0.67735285  0.67707567  0.67519093  0.68984268  0.71634295\n",
      "  0.72512566  0.71891892  0.72097931  0.76339548  0.73899473  0.76760699\n",
      "  0.77975929  0.79495954  0.80954629  0.80755277  0.82120303  0.83071118\n",
      "  0.84063897  0.84816172  0.87126381  0.87066814  0.86721405  0.88848418\n",
      "  0.89264493  0.91080931  0.90673003  0.92096967  0.94893859  0.94932297\n",
      "  0.95704853  0.96274865  0.9798643   0.99365338]\n",
      "[0.01639406 0.01243269 0.00278183 0.0359171  0.03876367 0.05392846\n",
      " 0.07460781 0.06772848 0.08192267 0.09008849 0.10264702 0.1148851\n",
      " 0.12835939 0.15414029 0.14344492 0.14839038 0.16783788 0.17045146\n",
      " 0.18247423 0.19958019 0.18947623 0.20885757 0.22240236 0.21778351\n",
      " 0.24069719 0.2359146  0.26470103 0.26006965 0.2858888  0.28993941\n",
      " 0.30516312 0.30637916 0.30553371 0.32783521 0.34848203 0.3513499\n",
      " 0.35087938 0.37241616 0.37622349 0.41809291 0.40833542 0.41250692\n",
      " 0.43171587 0.42095833 0.44071775 0.44489462 0.45731264 0.47119459\n",
      " 0.48843815 0.48298871 0.4852706  0.50849815 0.53163003 0.52145151\n",
      " 0.53859348 0.55459006 0.55185411 0.56319355 0.5648755  0.59285023\n",
      " 0.59494379 0.62632272 0.63160434 0.62765015 0.65815511 0.62882982\n",
      " 0.65575738 0.66264715 0.68292433 0.70480907 0.71015732 0.70365705\n",
      " 0.71487434 0.74108108 0.75902069 0.73660452 0.78100527 0.77239301\n",
      " 0.78024071 0.78504046 0.79045371 0.81244723 0.81879697 0.82928882\n",
      " 0.83936103 0.85183828 0.84873619 0.86933186 0.89278595 0.89151582\n",
      " 0.90735507 0.90919069 0.93326997 0.93903033 0.93106141 0.95067703\n",
      " 0.96295147 0.97725135 0.9801357  0.98634662]\n",
      "[-0.00000000e+00 -2.43269452e-05  3.44363307e-04 -1.77513142e-04\n",
      "  4.94532517e-05 -1.96423072e-04 -8.76468707e-04  1.59006409e-04\n",
      " -1.53813767e-04 -7.96445158e-06 -2.64701869e-04 -5.37360938e-04\n",
      " -1.00312679e-03 -3.13823712e-03 -4.82289251e-04  2.41443169e-04\n",
      " -1.25406122e-03 -7.67490030e-05 -4.45362215e-04 -1.82023621e-03\n",
      "  2.10475337e-03  2.39909374e-04 -5.28519014e-04  2.80979164e-03\n",
      " -1.67324790e-04  3.52135095e-03 -1.22226773e-03  2.68119399e-03\n",
      " -1.64886481e-03  1.75697262e-05 -1.54893721e-03  1.12246065e-03\n",
      "  4.62921312e-03  7.14381597e-04 -2.88388879e-03 -4.72466152e-04\n",
      "  3.28342344e-03 -8.93978001e-04  1.43507211e-03 -1.09562349e-02\n",
      " -3.33416922e-03 -1.02783525e-03 -4.92066579e-03  3.88791995e-03\n",
      " -3.15809361e-04  2.29741896e-03  1.23618395e-03 -5.61455687e-04\n",
      " -4.05030971e-03  3.43553029e-03  7.36469989e-03  7.65945720e-04\n",
      " -6.04761709e-03  4.53069948e-03  7.59523073e-04 -2.52453123e-03\n",
      "  4.56169988e-03  3.87967649e-03  8.77220879e-03 -1.68163318e-03\n",
      "  3.03372510e-03 -9.95685863e-03 -7.19469040e-03  1.48040386e-03\n",
      " -1.16192692e-02  1.37606170e-02  2.80012997e-03  4.92641179e-03\n",
      " -1.98854101e-03 -1.02182600e-02 -7.11012554e-03  4.50349479e-03\n",
      "  3.69047261e-03 -8.08919051e-03 -1.40753139e-02  1.00466082e-02\n",
      " -1.59640067e-02 -1.84261770e-03 -1.87751303e-04  3.91803704e-03\n",
      "  7.63702807e-03 -1.98225702e-03  9.86485595e-04  5.90276500e-04\n",
      "  5.36735758e-04 -1.56254163e-03  9.68687365e-03  5.81284385e-04\n",
      " -1.12516387e-02 -1.34908108e-03 -6.61955866e-03  7.36474172e-04\n",
      " -1.22083734e-02 -8.39820336e-03  8.40227114e-03 -6.43180646e-04\n",
      " -2.83341489e-03 -7.03380811e-03 -1.32990854e-04  3.61684967e-03]\n",
      "[-0.00000000e+00 -2.43269452e-05  3.44363307e-04 -1.77513142e-04\n",
      "  4.94532517e-05 -1.96423072e-04 -8.76468707e-04  1.59006409e-04\n",
      " -1.53813767e-04 -7.96445158e-06 -2.64701869e-04 -5.37360938e-04\n",
      " -1.00312679e-03 -3.13823712e-03 -4.82289251e-04  2.41443169e-04\n",
      " -1.25406122e-03 -7.67490030e-05 -4.45362215e-04 -1.82023621e-03\n",
      "  2.10475337e-03  2.39909374e-04 -5.28519014e-04  2.80979164e-03\n",
      " -1.67324790e-04  3.52135095e-03 -1.22226773e-03  2.68119399e-03\n",
      " -1.64886481e-03  1.75697262e-05 -1.54893721e-03  1.12246065e-03\n",
      "  4.62921312e-03  7.14381597e-04 -2.88388879e-03 -4.72466152e-04\n",
      "  3.28342344e-03 -8.93978001e-04  1.43507211e-03 -1.09562349e-02\n",
      " -3.33416922e-03 -1.02783525e-03 -4.92066579e-03  3.88791995e-03\n",
      " -3.15809361e-04  2.29741896e-03  1.23618395e-03 -5.61455687e-04\n",
      " -4.05030971e-03  3.43553029e-03  7.36469989e-03  7.65945720e-04\n",
      " -6.04761709e-03  4.53069948e-03  7.59523073e-04 -2.52453123e-03\n",
      "  4.56169988e-03  3.87967649e-03  8.77220879e-03 -1.68163318e-03\n",
      "  3.03372510e-03 -9.95685863e-03 -7.19469040e-03  1.48040386e-03\n",
      " -1.16192692e-02  1.37606170e-02  2.80012997e-03  4.92641179e-03\n",
      " -1.98854101e-03 -1.02182600e-02 -7.11012554e-03  4.50349479e-03\n",
      "  3.69047261e-03 -8.08919051e-03 -1.40753139e-02  1.00466082e-02\n",
      " -1.59640067e-02 -1.84261770e-03 -1.87751303e-04  3.91803704e-03\n",
      "  7.63702807e-03 -1.98225702e-03  9.86485595e-04  5.90276500e-04\n",
      "  5.36735758e-04 -1.56254163e-03  9.68687365e-03  5.81284385e-04\n",
      " -1.12516387e-02 -1.34908108e-03 -6.61955866e-03  7.36474172e-04\n",
      " -1.22083734e-02 -8.39820336e-03  8.40227114e-03 -6.43180646e-04\n",
      " -2.83341489e-03 -7.03380811e-03 -1.32990854e-04  3.61684967e-03]\n",
      "49.49999999999999\n",
      "0.49499999999999994\n",
      "0.2886607004772212\n",
      "0.08332500000000001\n",
      "0.0\n",
      "0.99\n"
     ]
    }
   ],
   "source": [
    "#实验名称：NumPy数值计算\n",
    "import numpy as np\n",
    "arr1=np.arange(0,1,0.01)\n",
    "print(arr1)\n",
    "\n",
    "arr2=np.random.normal(loc=0,scale=1e-2,size=100) #均值 标准差 个数\n",
    "print(arr2)\n",
    "\n",
    "print(arr1+arr2)\n",
    "print(arr1-arr2)\n",
    "print(arr1*arr2)\n",
    "print(np.multiply(arr1,arr2))#按位相乘\n",
    "\n",
    "print(arr1.sum())#求和\n",
    "print(arr1.mean())#求平均\n",
    "print(arr1.std())#求标准差\n",
    "print(arr1.var())#求方差\n",
    "print(arr1.min())#最小值\n",
    "print(arr1.max())#最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0 1 0 1 0 1 0 1]\n",
      " [1 0 1 0 1 0 1 0]\n",
      " [0 1 0 1 0 1 0 1]\n",
      " [1 0 1 0 1 0 1 0]\n",
      " [0 1 0 1 0 1 0 1]\n",
      " [1 0 1 0 1 0 1 0]\n",
      " [0 1 0 1 0 1 0 1]\n",
      " [1 0 1 0 1 0 1 0]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr3=np.zeros(shape=[8,8], dtype = int, order = 'C')\n",
    "for i in range(0,8,1):\n",
    "    for j in range(0,8,1):\n",
    "        if (i+j)%2:\n",
    "            arr3[i][j]=1\n",
    "print(arr3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Cannot load file containing pickled data when allow_pickle=False",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-3-cce14c1536a1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0marr4\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mload\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"iris_sepal_length.csv\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      3\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marr4\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\numpy\\lib\\npyio.py\u001b[0m in \u001b[0;36mload\u001b[1;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[0;32m    455\u001b[0m             \u001b[1;31m# Try a pickle\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    456\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mallow_pickle\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 457\u001b[1;33m                 raise ValueError(\"Cannot load file containing pickled data \"\n\u001b[0m\u001b[0;32m    458\u001b[0m                                  \"when allow_pickle=False\")\n\u001b[0;32m    459\u001b[0m             \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Cannot load file containing pickled data when allow_pickle=False"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr4=np.load(\"iris_sepal_length.csv\")\n",
    "print(arr4)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
